<div id="left">
	Categories
	<div class="new-item"><a href="<?php echo site_url('admin/newCategory'); ?>">Add Category</a></div>
	<ul>		
		<?php 
			foreach($categories as $category)
			{
				echo '<li><a href="'.site_url('admin/showProductsOfCategory/'.$category['id']).'">' .$category['category']. '</a>';
				echo '&nbsp; [<a href="'.site_url('admin/editCategory/'.$category['id']).'">Edit</a>]'.  '</li>';
			}
		?>
	</ul>
</div>
<div id="main">
	<h2>List of products</h2>
	<div class="new-item"><a href="<?php echo site_url('admin/newProduct'); ?>">Add Product</a></div>
	<table>
		<tr>
			<th>Id</th>
			<th>Name</th>
			<th>Image</th>
			<th>Price</th>
			<th>Quantity</th>
			<th>Category_Id</th>
		</tr>
		<?php
			foreach($products as $product)
			{
				echo '
					<tr align="center">
						<td>'.$product['id'].'</td>
						<td><a href="'.site_url('admin/editProduct/'.$product['id']).'">'.$product['name'].'</a></td>
						<td><image src="'.base_url('upload/image/products/'.$product['image']).'" width="100px" height="100px" /></td>
						<td>'.$product['price'].'</td>
						<td>'.$product['quantity'].'</td>
						<td>'.$product['category_id'].'</td>
					</tr>
				';
			}
		?>
		<tr align="center">
			<td colspan="6">
				<?php echo $products_paging; ?>
			</td>
		</tr>
	</table>
</div>
<div style="clear: both;"></div>